<script setup>
import { ref, defineProps, watch, defineEmits, handleError } from "vue"
import tableDialog from "./tableDialog.vue";
import CollectionDialog from "./CollectionDialog.vue";
let dialogVisible = ref(true)
const props = defineProps({
    isDialog: Boolean
})
let isTabDialog= ref(false)
const emit = defineEmits(['closeDialog'])
watch(() => props.isDialog, (newVal, oldVal) => {
    console.log('newVal ==>', newVal)
    dialogVisible.value = newVal
})

function close() {
    isTabDialog.value = false
    emit('closeDialog', false)

}
function openTableDialog(){
    isTabDialog.value=true
    console.log('11 ==>',dialogVisible.value )
}
function closeDialog(){
    isTabDialog.value=false
}
</script>
<template>
    <div class="select-dialog">
        <el-dialog title="" v-model="dialogVisible" width="900" @close="close">
            <div class="dialog-content">
                <div class="title">选择商品方式</div>
                <div style="display: flex;justify-content: space-between;width: 788px;">
                    <div class="view-box" @click="openTableDialog" style="padding: 40px;">
                        <div style="display: flex;justify-content: center;"><img class="img"
                                src="@/assets/images/shelves/shopee.png" style="margin-right: 20px;" alt=""><img
                                class="img" src="@/assets/images/shelves/tiktok.png"></div>
                        <div class="line-one">采集店铺商品数据</div>
                        <div class="line-two">采集已有店铺数据需要您将您的店铺授权给到平台就可以实现店铺商品的批量采集</div>
                        <div class="line-three">前往已授权店铺列表</div>

                    </div>
                    <div class="view-box">
                        <div><img class="b-img" src="@/assets/images/shelves/record.png" alt=""></div>
                        <div class="line-one">手动添加商品</div>
                        <div class="line-two" style="width: 294px;">您需要手动将您的产品数据进行录入到我们的平台中</div>
                    </div>
                </div>
            </div>

        </el-dialog>
    </div>
    <tableDialog :isDialog="isTabDialog" @closeDialog="closeDialog"></tableDialog>
</template>

<style lang="scss" scoped>
.dialog-content {

    width: 868px;
    height: 408px;
    display: flex;
    flex-direction: column;
    align-items: center;

    .title {
        width: 100%;
        height: 36px;
        font-size: 30px;
        color: #1F2937;
        font-weight: 600;
        display: flex;
        justify-content: center;
        margin: 40px 0;
    }

    .view-box {
        width: 378px;
        height: 244px;
        border: 2px solid #E5E7EB;
        border-radius: 12px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        // justify-content: center;

        .img {
            width: 64px;
            height: 64px;
            cursor: pointer;
        }

        .line-one {
            margin-top: 16px;
            color: #1F2937;
            font-weight: 500;
            font-size: 20px;
            cursor: pointer;
        }

        .line-two {
            margin-top: 12px;
            color: #6B7280;
            font-size: 14px;
            text-align: center;
            cursor: pointer;
        }

        .line-three {
            margin-top: 10.41px;
            font-Family: "阿里妈妈方圆体 Alimama FangYuanTi VF";
            font-size: 14px;
            color: #165DFF;
            cursor: pointer;

        }

        .b-img {
            margin-top: 42px;
            width: 60px;
            height: 60px;
            cursor: pointer;
        }
    }
}
</style>
<style lang="scss">
.select-dialog {
    .el-dialog__headerbtn {
        display: none;
    }

}
</style>